;Assembler header file for Zipper
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:11:43 2005
;Tom Hughes, tom@compton.nu, 22 Sep 2002

        [       :LNOT: :DEF: Zipper_Hdr
        GBLS    Zipper_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_FileSwitch
        GBLS    Get_FileSwitch
        ]
        [       :LNOT: :DEF: FileSwitch_Hdr
Get_FileSwitch                  SETS    "GET oslib/FileSwitch.Hdr"
        |
Get_FileSwitch                  SETS    ""
        ]
        $Get_FileSwitch

;Symbols for constants
Zipper_Append                   *       &1
Zipper_NoDiscard                *       &80000000
Zipper_CompressionMethod        *       &FF
Zipper_CompressionMethodShift   *       0
Zipper_CompressionLevel         *       &F00
Zipper_CompressionLevelShift    *       8
Zipper_CompressionMethodStore   *       &0
Zipper_CompressionMethodDeflate *       &8
Zipper_CompressionLevelMinimum  *       &1
Zipper_CompressionLevelMaximum  *       &9

;Symbols for structure offsets and sizes
Zipper_UnZipHandle              *       4 ;abstract type
Zipper_ZipHandle                *       4 ;abstract type
                                ^       0
                                #       Bits
Zipper_OpenFlags                *       @

                                ^       0
                                #       Bits
Zipper_CloseFlags               *       @

                                ^       0
                                #       Bits
Zipper_EnumerateFlags           *       @

                                ^       0
                                #       Bits
Zipper_InfoFlags                *       @

                                ^       0
                                #       Bits
Zipper_FileOpenFlags            *       @

                                ^       0
                                #       Bits
Zipper_FileCloseFlags           *       @

                                ^       0
                                #       Bits
Zipper_FileReadFlags            *       @

                                ^       0
                                #       Bits
Zipper_FileEOFFlags             *       @

                                ^       0
                                #       Bits
Zipper_FileWriteFlags           *       @

                                ^       0
                                #       Bits
Zipper_CompressionDetails       *       @

                                ^       0
Zipper_TimeSpecifier_riscos_style_load_addr #       Bits
Zipper_TimeSpecifier_riscos_style_exec_addr #       Bits
Zipper_TimeSpecifier_riscos_style_attr #       FileSwitch_Attr
                                ^       0
Zipper_TimeSpecifier_zip_style_centiseconds #       Int
Zipper_TimeSpecifier_zip_style_seconds #       Int
Zipper_TimeSpecifier_zip_style_minutes #       Int
Zipper_TimeSpecifier_zip_style_hours #       Int
Zipper_TimeSpecifier_zip_style_date #       Int
Zipper_TimeSpecifier_zip_style_month #       Int
Zipper_TimeSpecifier_zip_style_year #       Int
Zipper_TimeSpecifier            *       @

                                ^       0
Zipper_FileAttributes_internal  #       Bits
Zipper_FileAttributes_external  #       Bits
Zipper_FileAttributes           *       @


;Symbols for SWI's and SWI reason codes
XZipper_UnZipOpen               *       &759C0
Zipper_UnZipOpen                *       &559C0
   ;Entry
   ;  R0 = flags (Zipper_OpenFlags)
   ;  R1 -> filename (Char)
   ;Exit
   ;  R0 = handle (Zipper_UnZipHandle)

XZipper_UnZipClose              *       &759C1
Zipper_UnZipClose               *       &559C1
   ;Entry
   ;  R0 = flags (Zipper_CloseFlags)
   ;  R1 = handle (Zipper_UnZipHandle)

XZipper_UnZipInfo               *       &759C2
Zipper_UnZipInfo                *       &559C2

Zipper_UnZipInfoObjectCount     *       &0
   ;Entry
   ;  R0 = &0 :OR: flags (Zipper_InfoFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;Exit
   ;  R0 = objects (Int)

Zipper_UnZipInfoArchiveComment  *       &1
   ;Entry
   ;  R0 = &1 :OR: flags (Zipper_InfoFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 = buffer (pointer to data)
   ;  R3 = buffer_size (Int)
   ;Exit
   ;  R0 = read (Int)

XZipper_UnZipEnumerate          *       &759C3
Zipper_UnZipEnumerate           *       &559C3
   ;Entry
   ;  R0 = flags (Zipper_EnumerateFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 = buffer (pointer to data)
   ;  R3 = objects (Int)
   ;  R4 = offset (Int)
   ;  R5 = buffer_size (Int)
   ;Exit
   ;  R3 = objects_read (Int)
   ;  R4 = next_offset (Int)
   ;  R5 = buffer_unused (Int)

XZipper_UnZipFileInfoToBuffer   *       &759C4
Zipper_UnZipFileInfoToBuffer    *       &559C4
   ;Entry
   ;  R0 = flags (Zipper_EnumerateFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 -> filename (Char)
   ;  R3 = data (pointer to data)
   ;  R4 = data_size (Int)
   ;Exit
   ;  R3 = data_end (pointer to data)
   ;  R4 = data_unused (Int)

Zipper_UnZipFileInfoToRegisters *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 -> filename (Char)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_address (Bits)
   ;  R3 = exec_address (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

XZipper_UnZipFileOpen           *       &759C5
Zipper_UnZipFileOpen            *       &559C5
   ;Entry
   ;  R0 = flags (Zipper_FileOpenFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 -> filename (Char)

XZipper_UnZipFileClose          *       &759C6
Zipper_UnZipFileClose           *       &559C6
   ;Entry
   ;  R0 = flags (Zipper_FileCloseFlags)
   ;  R1 = handle (Zipper_UnZipHandle)

XZipper_UnZipFileRead           *       &759C7
Zipper_UnZipFileRead            *       &559C7
   ;Entry
   ;  R0 = flags (Zipper_FileReadFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 = data (pointer to data)
   ;  R3 = size (Int)
   ;Exit
   ;  R0 = read (Int)

XZipper_UnZipFileEOF            *       &759C8
Zipper_UnZipFileEOF             *       &559C8
   ;Entry
   ;  R0 = flags (Zipper_FileEOFFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;Exit
   ;  R0 = eof (Bool)

XZipper_ZipOpen                 *       &759D0
Zipper_ZipOpen                  *       &559D0
   ;Entry
   ;  R0 = flags (Zipper_OpenFlags)
   ;  R1 -> filename (Char)
   ;Exit
   ;  R0 = handle (Zipper_ZipHandle)

XZipper_ZipClose                *       &759D1
Zipper_ZipClose                 *       &559D1
   ;Entry
   ;  R0 = flags (Zipper_CloseFlags)
   ;  R1 = handle (Zipper_ZipHandle)

XZipper_ZipFileOpen             *       &759D2
Zipper_ZipFileOpen              *       &559D2
   ;Entry
   ;  R0 = flags (Zipper_FileOpenFlags)
   ;  R1 = handle (Zipper_ZipHandle)
   ;  R2 -> filename (Char)
   ;  R3 = compression_details (Zipper_CompressionDetails)
   ;  R4 -> time_specifier (Zipper_TimeSpecifier)
   ;  R5 -> extra (data)
   ;  R6 = extra_size (Int)
   ;  R7 -> comment (Char)
   ;  R8 -> attr (Zipper_FileAttributes)

XZipper_ZipFileClose            *       &759D3
Zipper_ZipFileClose             *       &559D3
   ;Entry
   ;  R0 = flags (Zipper_FileCloseFlags)
   ;  R1 = handle (Zipper_ZipHandle)
   ;Exit
   ;  R0 = uncompressed_size (Int)
   ;  R1 = compressed_size (Int)

XZipper_ZipFileWrite            *       &759D4
Zipper_ZipFileWrite             *       &559D4
   ;Entry
   ;  R0 = flags (Zipper_FileWriteFlags)
   ;  R1 = handle (Zipper_ZipHandle)
   ;  R2 = data (pointer to data)
   ;  R3 = size (Int)

        ]
        END
